package com.sikaryofficial.system.api.model;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.sikaryofficial.common.core.valid.ReferralCodeValid;
import com.sikaryofficial.common.core.valid.SexValid;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.hibernate.validator.constraints.Length;

import java.util.Date;

/**
 * 用户对象 sys_user
 *
 * @author qinjinyuan
 */
@Getter
@Setter
@ToString
@ApiModel(value = "用户基本信息更新请求入参", description = "用户基本信息更新请求入参")
public class UserProfileReq {
    /**
     * 手机号码
     */
    @ApiModelProperty(value = "手机号码")
    @Length(max = 20, message = "phonenumber cannot be greater than 20 chars")
    private String phonenumber;
    /**
     * 出生日期
     */
    @ApiModelProperty(value = "出生日期",example = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date birthDate;
    /**
     * 名字
     */
    @ApiModelProperty(value = "名字")
    @Length(max = 30, message = "firstName cannot be greater than 30 chars")
    private String firstName;
    /**
     * 姓
     */
    @ApiModelProperty(value = "姓")
    @Length(max = 30, message = "lastName cannot be greater than 30 chars")
    private String lastName;
    /**
     * 推荐码
     */
    @ApiModelProperty(value = "推荐码")
    @Length(max = 4, message = "referral Code cannot be greater than 4")
    @ReferralCodeValid(message = "referral Code must be lowercase letters or numbers")
    private String referralCode;
    /**
     * 用户性别
     */
    @ApiModelProperty(value = "用户性别:0=男,1=女,2=未知", example = "0")
    @Length(max = 1, message = "sex length cannot be greater than 1")
    @SexValid(message = "sex cannot be greater than 2")
    private String sex;
}
